#ifndef TRANSCODEWIDGET_H
#define TRANSCODEWIDGET_H

#include <QWidget>
#include <QDateEdit>
#include <QComboBox>
#include <QLineEdit>
#include <QPushButton>
#include <QProgressBar>

#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QFileDialog>
#include <QThread>
#include <QTimer>
#include<QLabel>
#include<QListWidget>
#include<QCalendarWidget>

#include"ffmpeg/transcodevideo.h"
#include"model/basemodel.h"
#include"contrl/mycontrol.h"
#include<QMessageBox>
#include"golob.h"
#include<QShowEvent>
class TranscodeWidget : public QWidget {
    Q_OBJECT
public:
    explicit TranscodeWidget(QWidget* parent = nullptr);
    ~TranscodeWidget();



      void SelectDataBase();

      void showEvent(QShowEvent *event);
signals:
    void ToMain();
private slots:
    void onBrowsePath();
    void startTranscoding();


    void showCalender();
    void selectCalender(const QDate &date);

    void ret();

    void reciveX(int x);




   // void reciverTowrite();//收到写入数据库的信号

private:
    void initWidgets();
    void initLayout();
    void loadVideoFiles(const QDate& date);
    void applyStyle();


    QPushButton*date_button;
    QCalendarWidget *calendarWidget;
    QComboBox* decodeCombo;
    QLineEdit* pathLineEdit;
    QPushButton* browseButton;
    QSlider*seekSlider;
    QListWidget * listWidget;
    QPushButton* confirmButton;
    QPushButton* returnButton;
    QWidget* scrollContent;
    QVBoxLayout* videoLayout;
    QString savePath;
    QTimer progressTimer;

    TransCodeVideo*transcode;


    BaseModel*model;
    MyControl *con;

    QList<Video*>videos;
    QList<Video*>selectVideos;
    int videoIndex=0;

    int x=0;




//    QHBoxLayout*listWidget_layout;
};

#endif // TRANSCODEWIDGET_H
